<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>TaskMaster - 注册</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">

    <!-- Tailwind 配置 -->
    <script>
        tailwind.config = {
            theme: {
                extend: {
                    colors: {
                        primary: '#165DFF',
                        secondary: '#36CFC9',
                        success: '#00B42A',
                        warning: '#FF7D00',
                        danger: '#F53F3F',
                        dark: '#1D2129',
                        'gray-light': '#F2F3F5',
                        'gray-medium': '#86909C',
                        'gray-dark': '#4E5969'
                    },
                    fontFamily: {
                        inter: ['Inter', 'sans-serif'],
                    },
                }
            }
        }
    </script>

    <style type="text/tailwindcss">
        @layer utilities {
            .content-auto {
                content-visibility: auto;
            }
            .hover-scale {
                transition: transform 0.2s ease;
            }
            .hover-scale:hover {
                transform: scale(1.02);
            }
        }
    </style>
</head>
<body class="font-inter bg-gray-light min-h-screen flex flex-col">
<!-- 注册页面 -->
<div class="flex-grow flex items-center justify-center p-4">
    <div class="w-full max-w-md">
        <div class="bg-white rounded-xl shadow-lg p-8 mb-6">
            <div class="text-center mb-6">
                <i class="fa fa-user-plus text-primary text-4xl"></i>
                <h2 class="text-2xl font-bold text-dark mt-2">创建账户</h2>
                <p class="text-gray-medium mt-1">加入 TaskMaster 开始高效管理你的任务</p>
            </div>

            <form id="register-form">
                <div class="mb-4">
                    <label class="block text-sm font-medium text-gray-dark mb-1">用户名</label>
                    <div class="relative">
                        <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
                            <i class="fa fa-user text-gray-medium"></i>
                        </div>
                        <input type="text" class="w-full pl-10 pr-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary/50" placeholder="输入你的用户名">
                    </div>
                </div>

                <div class="mb-4">
                    <label class="block text-sm font-medium text-gray-dark mb-1">密码</label>
                    <div class="relative">
                        <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
                            <i class="fa fa-lock text-gray-medium"></i>
                        </div>
                        <input type="password" class="w-full pl-10 pr-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary/50" placeholder="输入密码">
                    </div>
                </div>

                <div class="mb-6">
                    <label class="block text-sm font-medium text-gray-dark mb-1">确认密码</label>
                    <div class="relative">
                        <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
                            <i class="fa fa-lock text-gray-medium"></i>
                        </div>
                        <input type="password" class="w-full pl-10 pr-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary/50" placeholder="再次输入密码">
                    </div>
                </div>

                <div class="flex items-center mb-6">
                    <input type="checkbox" id="terms" class="w-5 h-5 text-primary rounded border-gray-300 focus:ring-primary">
                    <label for="terms" class="ml-2 text-sm text-gray-dark">我同意 <a href="#" class="text-primary hover:underline">服务条款</a> 和 <a href="#" class="text-primary hover:underline">隐私政策</a></label>
                </div>

                <button type="submit" class="w-full py-3 bg-primary text-white rounded-lg hover:bg-primary/90 transition-colors font-medium">
                    创建账户
                </button>

                <div class="flex items-center justify-center mt-6">
                    <span class="text-gray-medium text-sm">已有账号?</span>
                    <a href="#" class="ml-2 text-primary hover:text-primary/80 transition-colors font-medium">登录</a>
                </div>
            </form>
        </div>


        <script>
            // 表单验证示例
            document.getElementById('register-form').addEventListener('submit', function(e) {
                e.preventDefault();

                // 获取表单值
                const password = document.querySelector('input[type="password"]').value;
                const confirmPassword = document.querySelectorAll('input[type="password"]')[1].value;
                const terms = document.getElementById('terms').checked;

                // 简单验证
                if (password !== confirmPassword) {
                    alert('两次输入的密码不一致');
                    return;
                }

                if (!terms) {
                    alert('请同意服务条款和隐私政策');
                    return;
                }

                // 模拟注册成功
                alert('注册成功！将跳转到登录页面');
                window.location.href = '登陆页面.html';
            });
        </script>
</body>
</html>